Type-based heap and stack space analysis in Java
نویسندگان
چکیده
A type system is introduced for a strict but expressive subset of Java in order to infer resource upper bounds on both the heap-space and the stack-space requirements of typed programs. This type system is inspired by previous works on Implicit Computational Complexity, using tiering and noninterference techniques. The presented methodology has several advantages. First, it provides explicit polynomial upper bounds to the programmer, hence its use could allow the programmer to avoid memory errors. Second, type checking is decidable in linear time. Last but not least, it has a good expressivity since it analyzes most object oriented features like overload, inheritance, override and can also handle statements that alter the control flow like break or return. In particular, it improves previous analyses on the complexity of OO and imperative programs since it can deal with loops guarded by objects.
منابع مشابه
Stack Allocating Objects in Java ( Extended Abstract ) ∗
Allocating objects on the stack rather than the heap reduces the overhead of garbage collection and permits further optimizations. This paper presents a simple and fast algorithm for stack allocating a significant fraction of objects for Java programs. Our implementation in an optimizing batch Java compiler demonstrates the benefit of stack allocation by achieving speed improvements of up to 11...
متن کاملStacking-Based Context-Sensitive Points-to Analysis for Java
The precision of Java points-to analysis has always to be sacrificed for practical scalability. In particular, almost all the existing scalable analysis are based on cloning calling contexts [2] to obtain context-sensitivity. As such, recursive procedure calls have to be over-approximated inevitably in the analysis. However, empirical study on practiced Java benchmarks shows that typically more...
متن کاملAutomatic Accurate Stack Space and Heap Space Analysis for High-Level Languages
This paper describes a general approach for automatic and accurate space and space-bound analyses for high-level languages, considering stack space, heap allocation and live heap space usage of programs. The approach is based on program analysis and transformations and is fully automatic. The analyses produce accurate upper bounds in the presence of partially known input structures. The analyse...
متن کاملCompiler-Assisted Memory Management Using Escape Analysis in the KESO JVM
Escape analysis can be used for automatic memory management in Java. Based on the work of Choi et al. in 2003 [CGS03], this thesis improves the existing escape analysis in KESO, a Java virtual machine for deeply embedded systems. Enhancements implemented for this document include flow-sensitive analysis, modifications that reduce compile time and a fix for a conceptual flaw in the work of Choi ...
متن کاملStack-Based Typed Assembly Language
In previous work, we presented a Typed Assembly Language (TAL). TAL is sufficiently expressive to serve as a target language for compilers of high-level languages such as ML. This work assumed such a compiler would perform a continuation-passing style transform and eliminate the control stack by heap-allocating activation records. However, most compilers are based on stack allocation. This pape...
متن کامل